﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Masterpage.Master"
    CodeBehind="Car_Details.aspx.vb" Inherits="VintageCars.Cars_Details" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <%-- <asp:ScriptManager ID="ScriptManager1" runat="server" />--%>
    <ajax:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </ajax:ToolkitScriptManager>
    <div id="content_area1">
        <center>
            <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource2">
                <Columns>
                    <asp:BoundField DataField="Vehicle_Name" HeaderText="Vehicle Name" SortExpression="Vehicle_Name">
                        <HeaderStyle HorizontalAlign="Center" BackColor="Silver" ForeColor="Black" Font-Bold="True">
                        </HeaderStyle>
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    </asp:BoundField>
                    <asp:BoundField DataField="Vehicle_Description" HeaderText="Vehicle Description"
                        SortExpression="Vehicle_Description">
                        <HeaderStyle HorizontalAlign="Center" BackColor="Silver" ForeColor="Black" Font-Bold="True">
                        </HeaderStyle>
                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                    </asp:BoundField>
                    <asp:ImageField DataImageUrlField="Vehicle_Picture" HeaderText="Image" HeaderStyle-BackColor="Silver" />
                </Columns>
            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:carsconn %>"
                ProviderName="<%$ ConnectionStrings:carsconn.ProviderName %>" SelectCommand="SELECT [Vehicle_Name], [Vehicle_RegNo], [Vehicle_Year], [Vehicle_EngSize], [Vehicle_Make], [Vehicle_Price], [Vehicle_Contact], [Vehicle_Description], [Vehicle_Picture] FROM [Vehicle_Overview] WHERE ([ID] = ?)">
                <SelectParameters>
                    <asp:QueryStringParameter DefaultValue="1" Name="ID" QueryStringField="ID" Type="Int32" />
                </SelectParameters>
            </asp:SqlDataSource>
        </center>
        <b>The Current Rating of this Muscle Car is:</b>&nbsp;
        <asp:Label ID="lblMyRating" runat="server" Font-Bold="true"></asp:Label>
        <ajax:Rating ID="Rating2" runat="server" BorderStyle="Solid" BorderWidth="1px" CurrentRating="0"
            EmptyStarCssClass="emptyRatingStar" FilledStarCssClass="filledRatingStar" Height="40px"
            StarCssClass="ratingStar" WaitingStarCssClass="savedRatingStar" Width="198px"
            ReadOnly="True">
        </ajax:Rating>
    </div>
    <div>
        <center>
            <p>
                <b>People thought this Muscle Car was:</b>
                <asp:BulletedList ID="bulList" runat="server" DataSourceID="SqlDataSource4" DataTextField="Tags"
                    DataValueField="Tags" BulletStyle="Square ">
                </asp:BulletedList>
                <asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:carsconn %>"
                    ProviderName="<%$ ConnectionStrings:carsconn.ProviderName %>" SelectCommand="SELECT DISTINCT [Tags], [ID] FROM [CatTagJunc] WHERE ([ID] = ?)">
                    <SelectParameters>
                        <asp:QueryStringParameter Name="ID" QueryStringField="ID" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </p>
        </center>
    </div>
    <asp:UpdatePanel ID="update1" runat="server">
        <ContentTemplate>
            <table class="desOutertable">
                <tr>
                    <td colspan="4">
                        <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
                            ShowSummary="False" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <ajax:CollapsiblePanelExtender ID="cpeRegistration" runat="server" TargetControlID="pnlRegistrationDetails"
                            ExpandControlID="pnlRegistrationTitle" CollapseControlID="pnlRegistrationTitle"
                            Collapsed="true">
                        </ajax:CollapsiblePanelExtender>
                        <asp:Panel ID="pnlRegistrationTitle" CssClass="AccodionHeader" runat="server" Width="100%"
                            Height="40px" Visible="true" BorderColor="Silver" BackColor="Gray">
                            <table width="100%" class="desOutertable">
                                <tr>
                                    <td>
                                        <span style="font-weight: bold;">Click Here For User Comments</span> </p>
                                    </td>
                                    <td width="10%">
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                        <asp:Panel ID="pnlRegistrationDetails" runat="server" Width="100%" Visible="true">
                            <div>
                                <asp:Repeater ID="RepDetails" runat="server">
                                    <HeaderTemplate>
                                        <table class="desOutertable">
                                            <tr class="desHeadText ">
                                                <td colspan="2">
                                                    <b>Comments</b>
                                                </td>
                                            </tr>
                                    </HeaderTemplate>
                                    <ItemTemplate>
                                        <tr>
                                            <td>
                                                <table style="background-color: #EBEFF0; border-top: 1px dotted #df5015; width: 100%">
                                                    <tr>
                                                        <td>
                                                            Subject:
                                                            <asp:Label ID="lblSubject" runat="server" Text='<%#Eval("VehCom_Title") %>' Font-Bold="true" />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <asp:Label ID="lblComment" runat="server" Text='<%#Eval("VehCom_Mesg") %>' />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <table style="width: 100%">
                                                    <tr>
                                                        <td>
                                                            Post By:
                                                            <asp:Label ID="lblUser" runat="server" Font-Bold="true" Text='<%#Eval("VehCom_Author") %>' />
                                                        </td>
                                                        <td>
                                                            Posted On:<asp:Label ID="lblDate" runat="server" Font-Bold="true" Text='<%#Eval("PostedDate") %>' />
                                                        </td>
                                                    </tr>
                                                </table>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="2">
                                                &nbsp;
                                            </td>
                                        </tr>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        </table>
                                    </FooterTemplate>
                                </asp:Repeater>
                            </div>
                            <table class="desOutertable">
                                <tr>
                                    <td class="desHeadText " colspan="4">
                                        &nbsp;&nbsp;
                                        <asp:Label ID="lbldisp" runat="server" CssClass="desHeadText" Text="Type Your Comments Below"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="desStatictext" colspan="4">
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Post Your Comments
                                    </td>
                                    <td>
                                        <asp:LoginName ID="LoginName1" runat="server" Height="22px" />
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Title
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtTitle" runat="server" Height="22px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Message
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtMessage" runat="server" TextMode="MultiLine" Width="500px" Height="88px"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                    </td>
                                    <td>
                                        <asp:Button ID="btnSubmit" runat="server" Text="Comment" />
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                        <ajax:CollapsiblePanelExtender ID="cpeTag" runat="server" TargetControlID="pnlTagg"
                            ExpandControlID="pnlTag" CollapseControlID="pnlTag" Collapsed="true">
                        </ajax:CollapsiblePanelExtender>
                        <asp:Panel ID="pnlTag" CssClass="AccodionHeader" runat="server" Width="100%" Height="40px"
                            Visible="true" BorderColor="Silver" BackColor="Gray">
                            <table width="100%" class="desOutertable">
                                <tr>
                                    <td>
                                        <span style="font-weight: bold;">Click Here For Tagging</span> </p>
                                    </td>
                                    <td width="10%">
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                        <asp:Panel ID="pnlTagg" runat="server" Width="100%" Visible="true">
                            <table class="desOutertable">
                                <tr>
                                    <td class="desHeadText " colspan="4">
                                        &nbsp;&nbsp;
                                        <asp:Label ID="Label1" runat="server" CssClass="desHeadText" Text="Tagging"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                    </td>
                                    <td>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        TAG Me
                                    </td>
                                    <td align="center">
                                        <asp:TextBox ID="txtCarTags" runat="server" Height="22px" Width="200px"></asp:TextBox>
                                    </td>
                                    <td>
                                        <asp:Button ID="btnTag" runat="server" Text="Tag" Width="70px" Height="30px" />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="4">
                                        <asp:CheckBoxList ID="CheckBoxList1" runat="server" DataSourceID="SqlDataSource3"
                                            DataTextField="Tags" DataValueField="ID" RepeatDirection="Horizontal">
                                        </asp:CheckBoxList>
                                        <asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:carsconn %>"
                                            ProviderName="<%$ ConnectionStrings:carsconn.ProviderName %>" SelectCommand="SELECT [ID], [Tags] FROM [Tagging]">
                                        </asp:SqlDataSource>
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                        <ajax:CollapsiblePanelExtender ID="cpeStars" runat="server" TargetControlID="pnlStar"
                            ExpandControlID="pnlStars" CollapseControlID="pnlStars" Collapsed="true">
                        </ajax:CollapsiblePanelExtender>
                        <asp:Panel ID="pnlStars" CssClass="AccodionHeader" runat="server" Width="100%" Height="40px"
                            Visible="true" BorderColor="Silver" BackColor="Gray">
                            <table width="100%" class="desOutertable">
                                <tr>
                                    <td>
                                        <span style="font-weight: bold;">Click Here For Rating</span> </p>
                                    </td>
                                    <td width="10%">
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                        <asp:Panel ID="pnlStar" runat="server" Width="100%" Visible="true">
                            <table class="desOutertable">
                                <tr>
                                    <td class="desHeadText " colspan="4">
                                        &nbsp;&nbsp;
                                        <asp:Label ID="Label2" runat="server" CssClass="desHeadText" Text="Rating"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        <b>Select STARS for RATING</b>
                                        <ajax:Rating ID="Rating1" runat="server" BorderStyle="Solid" BorderWidth="1px" CurrentRating="0"
                                            EmptyStarCssClass="emptyRatingStar" FilledStarCssClass="filledRatingStar" Height="40px"
                                            StarCssClass="ratingStar" WaitingStarCssClass="savedRatingStar" Width="200px"
                                            OnChanged="RatingControlChanged" AutoPostBack="true">
                                        </ajax:Rating>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        <div style="position: relative; vertical-align: top; height: 300px; overflow: auto;
                                            width: 1000px">
                                            <asp:GridView ID="GridView3" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource5"
                                                Width="50%">
                                                <Columns>
                                                    <asp:BoundField DataField="Vehicle_Name" HeaderText="Vehicle Name" SortExpression="Vehicle_Name">
                                                        <HeaderStyle HorizontalAlign="Center" Width="5%" BackColor="#736F6E" ForeColor="Black"
                                                            Font-Bold="True"></HeaderStyle>
                                                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                    </asp:BoundField>
                                                    <asp:BoundField DataField="AverageRating" HeaderText="Average Rating" ReadOnly="True"
                                                        SortExpression="AverageRating">
                                                        <HeaderStyle HorizontalAlign="Center" Width="5%" BackColor="#736F6E" ForeColor="Black"
                                                            Font-Bold="True"></HeaderStyle>
                                                        <ItemStyle HorizontalAlign="Center"></ItemStyle>
                                                    </asp:BoundField>
                                                    <asp:ImageField DataImageUrlField="Vehicle_Picture" HeaderText="Image" HeaderStyle-BackColor="#736F6E">
                                                        <ControlStyle Height="200px" Width="400px" />
                                                        <ItemStyle Height="75px" Width="75px" />
                                                    </asp:ImageField>
                                                </Columns>
                                            </asp:GridView>
                                            <asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:carsconn %>"
                                                ProviderName="<%$ ConnectionStrings:carsconn.ProviderName %>" SelectCommand="SELECT [Vehicle_Picture], [Vehicle_Name], [AverageRating] FROM [CarAVG] WHERE ([AverageRating] IS NOT NULL)">
                                            </asp:SqlDataSource>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
